/**
 * Created by Administrator on 2017/4/25.
 */
var ProjectSelect = React.createClass({
    getDefaultProps:function(){
        return{
            data: {
                label: "",
                selectOption: [],
                curVal: 0
            }
        }
    },
    callback: function(v){
        this.props.callBack(v);
    },
    render:function(){
        var _this = this;
        return(
            <div className="row">
                <span className="title">{_this.props.data.label}</span>
                <ul ref="projectStatus">
                    {
                        _this.props.data.selectOption.map(function(item,index){
                            var className = "";
                            if(index == 0){
                                className = "current";
                            }else if(index != 0 && item.value==_this.props.data.curVal){
                                className = "curr";
                            }
                            return (
                                <li><a className={className} href="javascript:;" onclick={_this.callback.bind(_this,item.value)}>{item.text}</a></li>
                            )
                        })
                    }
                </ul>
            </div>
        )
    }
});
module.exports = ProjectSelect;